package com.miaosha.redis.list;

import redis.clients.jedis.Jedis;

/**
 * @author lsq
 * @create 2021-10-10 18:17
 * @description
 * @menu
 **/
public class SecKillDemo {

    private Jedis jedis = new Jedis("182.42.113.98", 6379);

    /**
     * 秒杀请求入队
     *
     * @param secKillRequest
     */
    public void enqueueSecKillRequest(String secKillRequest) {
        jedis.lpush("sec_kill_request_queue", secKillRequest);
    }

    /**
     * 秒杀请求出队
     *
     * @return
     */
    public String dequeueSecKillRequest() {
        return jedis.rpop("sec_kill_request_queue");
    }
}
